package com.kemang.Moblie;

import java.util.function.IntToDoubleFunction;

public class MobileTest {
    public static void main(String[] args) {
        Mobile phone1=new Mobile("华为",5000,"grey");
        Mobile phone2=new Mobile("Apple",4500,"red");
        Mobile phone3=new Mobile("vivo",3650,"white");
        double average=avg(phone1,phone2,phone3);
//        System.out.println(average);
        System.out.printf("%.2f",average);
    }
    public static double avg(Mobile phone1,Mobile phone2,Mobile phone3){
        double sum=phone1.getPrice()+phone2.getPrice()+phone3.getPrice();
        double average=sum/3;
        return average;
    }
}
